<div class="well">
	<h2><?=lang("word_hello").', '.$this->session->userdata('username');?>!</h2>
			
		<h3><?=lang("profile_contest_created")?></h3>
		<?php
		$this->load->model('projectmodel');
		$this->load->model('users');
		
		$this->db->from('projects');
		$this->db->join('style', 'projects.cd_style = style.id_style');
		$this->db->where('projects.cd_user', $this->session->userdata('id'));
		
		$query = $this->db->get();
		
		if($query->num_rows()>0){
			echo '<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th style="width: 80px">Estilo</th>
					<th>Descrição</th>
					<th style="width: 150px">data</th>
				</tr>
			</thead>';
			foreach ($query->result() as $row)
			{
				echo '<tr>';
				echo '<td><p class="text-center">'.$row->nm_style.'<br/><a href="project/view/'.$row->id_project.'" class="btn btn-success">Visualizar</a></p></td>';
				echo '<td><strong>'.$row->nm_project.'</strong><br/>'.$row->ds_description.'</td>';
				echo '<td>Início: '.$row->dt_begin .'<br/>Fim: '. $row->dt_end.'<br/>Valor: R$'.$row->vl_value.'</td>';
				echo '</tr>';
			   
			}
			echo '</table>';
		}else{ ?>
			<p>Você não possui nenhum projeto criado ainda</p>
			<a href="<?=base_url()?>newproject" class="btn btn-success"><i class="icon icon-plus-sign icon-white"></i> Criar um novo projeto</a>
		<?php } ?>
		
</div>